package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.QualityRecordMapper;
import com.ruoyi.system.domain.QualityRecord;
import com.ruoyi.system.service.IQualityRecordService;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ruoyi
 * @date 2023-11-27
 */
@Service
public class QualityRecordServiceImpl implements IQualityRecordService
{
    @Autowired
    private QualityRecordMapper qualityRecordMapper;

    /**
     * 查询【请填写功能名称】
     *
     * @param id 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public QualityRecord selectQualityRecordById(Long id)
    {
        return qualityRecordMapper.selectQualityRecordById(id);
    }

    /**
     * 查询【请填写功能名称】列表
     *
     * @param qualityRecord 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<QualityRecord> selectQualityRecordList(QualityRecord qualityRecord)
    {
        return qualityRecordMapper.selectQualityRecordList(qualityRecord);
    }

    /**
     * 新增【请填写功能名称】
     *
     * @param qualityRecord 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertQualityRecord(QualityRecord qualityRecord)
    {
        qualityRecord.setCreateBy(SecurityUtils.getNickName());
        qualityRecord.setCreateTime(new Date());
        return qualityRecordMapper.insertQualityRecord(qualityRecord);
    }

    /**
     * 修改【请填写功能名称】
     *
     * @param qualityRecord 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateQualityRecord(QualityRecord qualityRecord)
    {
        qualityRecord.setUpdateBy(SecurityUtils.getNickName());
        qualityRecord.setUpdateTime(new Date());
        return qualityRecordMapper.updateQualityRecord(qualityRecord);
    }

    /**
     * 批量删除【请填写功能名称】
     *
     * @param ids 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteQualityRecordByIds(Long[] ids)
    {
        return qualityRecordMapper.deleteQualityRecordByIds(ids);
    }

    /**
     * 删除【请填写功能名称】信息
     *
     * @param id 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteQualityRecordById(Long id)
    {
        return qualityRecordMapper.deleteQualityRecordById(id);
    }
}
